Page({
  onShow() {
    this.getRepairList()
  },
  // 获取报修列表数据
  getRepairList() {
    const list = wx.getStorageSync('repaireEvent')
    let repairList = []
    if (list) {
      repairList = list.map(item => {
        return {
          repairItemName: getApp().getrepaName(item.repairItemId),
          id: item.id,
          mobile: item.mobile,
          appointment: item.appointment,
          status: 2,
          houseInfo: getApp().getAdress(item.houseId)
        }
      })
    }

    this.setData({
      repairList
    })
  },
  goDetail(ev) {
    const {
      id
    } = ev.mark
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + id,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
})